
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@endo/patterns
Advanced tools
@endo/patterns
The main export from the package is an M
namespace object, for making a variety of Matchers (hence "M"). For example:
import '@endo/init/debug.js';
import { M, mustMatch } from '@endo/patterns';
const specimen = harden({ foo: 3, bar: 4 });
const pattern = M.splitRecord(
{ foo: M.number() }, // required properties
{ bar: M.string(), baz: M.number() }, // optional
);
mustMatch(specimen, pattern); // throws: 'bar?: number 4 - Must be a string'
See {@link PatternMatchers} for more on M.splitRecord()
, M.number()
, and other methods.
M
also has {@link GuardMakers} methods to make {@link InterfaceGuard}s that use Patterns to characterize dynamic behavior such as method argument/response signatures and promise awaiting. The {@link @endo/exo!} package uses InterfaceGuard
s as the first level of defense for Exo objects against malformed input.
For best rendering, use the Endo reference docs site.
Builds on {@link @endo/pass-style!} as described in kindOf
and passStyleOf
levels of abstraction to define higher level data types as individual refinements of Passable CopyTagged records (PassStyle "tagged"):
In support of the above, there is also {@link compareKeys} and {@link keyEQ} exposing pass-invariant Key comparison, and two concepts with corresponding TypeScript types:
r
may be a child of multiple parents, e.g. { foo: r, bar: [r] }
). A Key is stable and stably comparable with other Keys via {@link keyEQ}. Key is the most general data type covering valid contents for CopySets and CopyBags and keys for CopyMaps (the last of which explains the "Key" name).keyEQ
considers identity only for Remotables, where it is shared across all local Presences of the same Remotable), or a Key-like structure in which one or more leaves is a Matcher rather than a primitive or Remotable.FAQs
Pattern matching for Passable objects, expressed as Passable data
The npm package @endo/patterns receives a total of 11,458 weekly downloads. As such, @endo/patterns popularity was classified as popular.
We found that @endo/patterns demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.